package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
//        StringBuilder sb = new StringBuilder();
//        StringBuilder sdl=new StringBuilder("abc");
//
//        String str ="abc";
//        StringBuilder sb1=new StringBuilder(str);
//        System.out.println(sb1);
//        String sb2 = sb1.toString();
//        System.out.println(sb2);
          String str="好好学习java";
          StringBuilder sb=new StringBuilder(str);
          sb.append(",为了找个好工作");
          System.out.println(sb);

          sb.replace(9,14,"就是为了改变世界");
          System.out.println(sb);

          sb.delete(0,8);
          System.out.println(sb);

          sb.insert(4,"活着");
          System.out.println(sb);






    }
}
